<!-- 材料申请列表 -->
<template>
<div>
    <a-card :bordered="false">
        <f-search-form :more="false" @searchHandler="searchHandler">
            <f-search-form-item label="项目代码" name="projectCode" />
            <f-search-form-item label="项目名称" name="projectName" />
        </f-search-form>
        <f-table ref="table"  rowKey="materialId"  size="default" :columns="columns" :multiple="false" :params="queryParam" :api="api.project">
            <span slot="action" slot-scope="text, record">
                <template>
                    <!-- $refs.modal.handleShow(record)" -->
                    <a @click="$refs.log.handleShow(record)">申请记录</a>
                    <a-divider type="vertical" />
                </template>
                <template>
                    <a @click="$refs.detailDrawer.showDrawer(record)">新增申请</a>
                    <a-divider type="vertical" />
                </template>
            </span>
        </f-table>
<!--        <ApplicationDetail ref="add" ></ApplicationDetail>-->
       <ApplicationdetailDrawer ref="detailDrawer"></ApplicationdetailDrawer>
       <ApplicationRecord ref="log"></ApplicationRecord>
    </a-card>
</div>
</template>

<script>
// import ApplicationDetail from './applicationdetail'
import ApplicationRecord from './applicationrecord'
import api from '../../material/app/js/api'
import ApplicationdetailDrawer from './applicationdetailDrawer'
export default {
    name: 'TableList',
    components: {
        ApplicationdetailDrawer,
        // ApplicationDetail,
        ApplicationRecord
    },
    data() {
        return {
          api:  Object.assign(api, this.api),
            //列表初始化查询参数
            queryParam: {},
            // 表头
            columns: [

              {
                    title: '项目代码',
                align: 'center',
                    dataIndex: 'projectCode',
                },
                {
                    title: '项目名称',
                  align: 'center',
                    dataIndex: 'projectName',
                },
                {
                    title: '创建人',
                  align: 'center',
                    dataIndex: 'userName',
                },
                {
                    title: '项目当前版本',
                  align: 'center',
                    dataIndex: 'bigVersion',
                },
                {
                    title: '最近一次版本提交时间',
                  align: 'center',
                    dataIndex: 'updateTime',
                },
                {
                    title: '操作',
                    dataIndex: 'action',
                    width: '180px',
                    scopedSlots: {
                        customRender: 'action',
                    }
                },
            ],
            //操作按钮
            operator: [{
                    name: '添加角色',
                    icon: 'plus',
                    that: this,
                    handler: function (table, that) {
                        that.$refs.modal.handleShow()
                    },
                },
                {
                    name: '删除',
                    icon: 'delete',
                    batch: true,
                    handler: function (table) {
                        table.remove()
                    },
                },
            ],
        }
    },
    methods: {
    // ss() {
    //   this.$http.get('base/bus/project/page',{params:{params:this.queryParam}})
    //
    //     .then(function(res){
    //       console.log("输出",res);
    //     });
    // }
    },
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {

  },
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {
      // this.ss();
  },
}
</script>

<style lang="scss" scoped>
//@import url(); 引入公共css类
</style>
